<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>查询结果</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../../plugins/mui/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="../../css/life_housekeeper/wate_index.css"/>
		<script src="../../js/statistics.js"></script>
		<script src="../../js/fontset.js"></script>
	</head>
	<body>
		<header class="mui-bar mui-bar-nav header">
		    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
		    <h1 class="mui-title">水费查询</h1>
		</header>
		<div class="mui-content">
			<div class="water-query-img">
				<img src="../../images/icon/life_housekeeper/water-query-bg.png" class="img-response" />
				<div class="query-table" id="queryTable">
				</div>
			</div>
			<div class="query-hint mui-text-center">
				<p class="mui-text-center" id="queryMsg"></p>
				<button class="query-btn" id="detailBtn">用水详情</button>
			</div>
		</div>
		<script src="../../plugins/mui/mui.min.js"></script>
		<script src="../../js/life_housekeeper/windowTitleView.js"></script>
		<script src="../../plugins/template/template.js"></script>
		<script type="text/html" id="queryInfo">
			<p class="query-table-tit mui-text-center">水费查询结果</p>
			<div class="query-table-view-cell">
				<span class="query-cell-tit">用户户号：</span>
				<span>{{code}}</span>
			</div>
			<div class="query-table-view-cell">
				<span class="query-cell-tit">用户名&nbsp;&nbsp;&nbsp;&nbsp;：</span>
				<span>{{name}}</span>
			</div>
			    <div class="query-table-view-cell">
					<span class="query-cell-tit">欠费水量：</span>
					<span {{if amount}} class="query-state-warning" {{/if}}>{{amount}}吨</span>
				</div>
				<div class="query-table-view-cell">
					<span class="query-cell-tit">欠费金额：</span>
					<span {{if amount}} class="query-state-warning" {{/if}}>{{money}}元</span>
				</div>
		</script>
		<script>
			mui.init();
			mui.plusReady(function(){
				plus.nativeUI.closeWaiting();
				var _self = plus.webview.currentWebview(),
				    data = _self.data;
				if(!data){
					return;
				}
				var queryHtml =template("queryInfo",data);
				var queryTable = document.getElementById("queryTable");
				var queryMsg = document.getElementById("queryMsg");
				var detailBtn = document.getElementById("detailBtn");
				queryTable.innerHTML = queryHtml;
				if(data.amount == 0){
					queryMsg.innerHTML = "您无未缴水费";
				}else{
					queryMsg.innerHTML = "请尽快前往缴费";
				}
				detailBtn.addEventListener('tap',function(){
					var viewOptions = {
					url:'water_detail.html',
					id:'water_detail'
					},
					extras ={
						code:data.code
					},
					titleOptions = {
						title:'水费详情',
						backImg:'whiteBack'
					};
					addTitleView(viewOptions,extras,titleOptions);
				},false)
			})
		</script>
	</body>
</html>
